/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package to.pm.personale.ejb;

import java.util.LinkedList;
import java.util.List;
import java.util.logging.Logger;
import javax.jws.WebService;
import javax.ejb.Stateless;
import to.pm.entity.personale.Dipendente;
import to.pm.entity.personale.Sede;

/**
 *
 * @author mauri
 */
@WebService()
@Stateless()
public class WSPersonale {
    Logger log=Logger.getAnonymousLogger();
    public boolean isMatricola(String matricola) {

        log.info("WS : "+matricola);
        if ("1".equals(matricola.trim())) {

            return false;}
        return true;
    }
    public Sede assegnatoA (Dipendente d) {
        if (d==null) {throw (new RuntimeException("dip null"));}
        Sede s = new Sede();
        s.setNome("TO1");
        s.setIndirizzo("Via Po 1");
        List l = new LinkedList();
        l.add(d);
        s.setDipendenti(l);
        return s;
    }

}
